using System;
using System.Collections.Generic;
using System.Text;
using Zsa.Emulation.Memory;

namespace Zsa.Emulation.Sound
{
    /// <summary>
    /// The sound controller.
    /// </summary>
    public class SoundController : MemoryBankStream
    {


//$4008 Write pAPU Triangle Control Register 1.
//$4009 Write pAPU Triangle Control Register 2.
//$400A Write pAPU Triangle Frequency Register 1.
//$400B Write pAPU Triangle Frequency Register 2.
//$400C Write pAPU Noise Control Register 1.
//$400E Write pAPU Noise Frequency Register 1.
//$400F Write pAPU Noise Frequency Register 2.
//$4010 Write pAPU Delta Modulation Control Register.
//$4011 Write pAPU Delta Modulation D/A Register.
//$4012 Write pAPU Delta Modulation Address Register.
//$4013 Write pAPU Delta Modulation Data Length Register.


        private ApuPulse _PulseOne;

        private ApuPulse _PulseTwo;



        private byte _Reg4009;

        private byte _Reg400A;

        private byte _Reg400B;

        private byte _Reg400C;

        private byte _Reg400D;

        private byte _Reg400E;

        private byte _Reg400F;

        private byte _Reg4011;

        private byte _Reg4012;

        private byte _Reg4013;

        /// <summary>
        /// pAPU Sound / Vertical Clock Signal Register.
        /// 0x4000
        /// </summary>
        private byte _Reg4015VerticalClockSignalRegister;

        public SoundController()
            : base ( 21, "Sound Memory")
        {
        }

        /// <summary>
        /// Gets or sets the reg4015.
        /// </summary>
        /// <value>The reg4015.</value>
        internal byte Reg4015
        {
            get { return _Reg4015VerticalClockSignalRegister; }
            set { _Reg4015VerticalClockSignalRegister = value; }
        }

        
        public override void Write(int address, byte romByte)
        {
            switch (address)
            {
                case 0x4009:
                    _Reg4009 = romByte;
                    break;
            }
        }

        public override void Write(byte[] buffer, int address, int count)
        {
            base.Write(buffer, address, count);
        }


      
    }
}
